<%@page language="java" contentType="text/html; charset=utf-8"%>
<%@include file="/commons/inc.jsp" %>
<h3 id="navTitleId">患者基本信息</h3>

<body id="body">

<%@include file="/commons/showmessage.jsp" %>

<form name="patientform" id="patientform" method="post" action="${contextPath}/patient/patient.action?method=saveEditPatient">
<table border="0" cellspacing="1" cellpadding="0" class="formTable" width="100%" >
	<s:hidden name="patientid" id="patientid"></s:hidden>
	<s:hidden name="interPG.seqid" id="patient.seqid"></s:hidden>
	<s:hidden name="interPG.patientid" id="interPG.patientid"></s:hidden>
	<tbody>
		<tr>
			<td align="left" class="form-td"><label class="label">姓名:</label></td>
			<td align="left" class="form-td"><input type="text" name="patient.patientname" maxlength="100" id="patient.patientname" value="${patient.patientname}" dataType="Noempty" msg="请输入姓名" /></td>	
			<td align="left" class="form-td"><label class="label">编号:</label></td>
			<td align="left" class="form-td"><input type="text" name="patient.patientid" size="10" maxlength="100" readonly="readonly" id="patient.patientid" value="${patient.patientid}" /></td>	
			<td align="left" class="form-td"><label class="label">费用类型:</label></td>
			<td align="left" class="form-td" colspan="3"><select name="patient.feetype" id="patient.feetype" style="width:80px;">
					<option value="0" <s:if test="patient.feetype == 0">selected</s:if>>请选择</option>
					<option value="1" <s:if test="patient.feetype == 1">selected</s:if>>医保</option>
					<option value="2" <s:if test="patient.feetype == 2">selected</s:if>>标准</option>
					<option value="3" <s:if test="patient.feetype == 3">selected</s:if>>其他</option>
				</select></td> 
		</tr>
		<tr>
			<td align="left" class="form-td"><label class="label">性别:</label></td>
			<td align="left" class="form-td"><select name="patient.gender" id="patient.gender" onchange="javascript:showbear();" style="width:80px;">
					<option value="0" <s:if test="patient.gender == 0">selected</s:if>>请选择</option>
					<option value="1" <s:if test="patient.gender == 1">selected</s:if>>男</option>
					<option value="2" <s:if test="patient.gender == 2">selected</s:if>>女</option>
				</select></td>
			<td align="left" class="form-td"><label class="label">民族:</label></td>
			<td align="left" class="form-td"><input type="text" name="patient.minzu" size="10" id="patient.minzu" value="${patient.minzu}"/></td> 
			<td align="left" class="form-td"><label class="label">生日:</label></td>
			<td align="left" class="form-td"><input size="15" class="Wdate" value="${patient.birthday}" type="text" onClick="WdatePicker()" onChange="javascript:compute();" dataType="Require" msg="请输入生日" name="patient.birthday" id="patient.birthday"/></td>
			<td align="left" class="form-td"><label class="label">年龄:</label></td>
			<td align="left" class="form-td"><input type="text" size="4" readonly="readonly" name="patient.age" id="patient.age" value="${patient.age}"/>岁</td>
		</tr>
		
		<tr>
			<td align="left" class="form-td"><label class="label">证件类型:</label></td>
			<td align="left" class="form-td"><select name="patient.cretype" id="patient.cretype" style="width:80px;">
					<option value="0" <s:if test="patient.cretype == 0">selected</s:if>>请选择</option>
					<option value="1" <s:if test="patient.cretype == 1">selected</s:if>>身份证</option>
					<option value="2" <s:if test="patient.cretype == 2">selected</s:if>>军人证</option>
					<option value="3" <s:if test="patient.cretype == 3">selected</s:if>>其他</option>
				</select></td>
			<td align="left" class="form-td"><label class="label">证件号码:</label></td>
			<td align="left" class="form-td" colspan="5"><input type="text" name="patient.crenum" id="patient.crenum" value="${patient.crenum}" dataType="Noempty" msg="请输入证件号码"/></td>
		</tr>
		
		<tr>
			<td align="left" class="form-td" class="tdLabel"><label class="label">工作单位:</label></td>
			<td align="left" class="form-td" colspan="7"><input type="text" name="patient.workplace" maxlength="100" id="patient.workplace" value="${patient.workplace}" size="55"/></td>
		</tr>
		
		<tr>
			<td align="left" class="form-td"><label class="label">工作性质:</label></td>
			<td align="left" class="form-td" colspan="7">	
				<input style="vertical-align:sub;" type="radio" name="patient.worktype1" id="junren" <s:if test="patient.worktype1==1">checked</s:if> value="1" onclick="javascript:chooseType('2');"/>
				<font style="vertical-align:sub;">军人</font>&nbsp;&nbsp;&nbsp;
				<select name="patient.worktype2" id="jun" <s:if test="patient.worktype1==0">disabled="disabled"</s:if>  style="width:80px;">
					<option value="0" <s:if test="patient.worktype1==1 && patient.worktype2 == 0">selected</s:if>></option>
					<option value="1" <s:if test="patient.worktype1==1 && patient.worktype2 == 1">selected</s:if>>陆军</option>
					<option value="2" <s:if test="patient.worktype1==1 && patient.worktype2 == 2">selected</s:if>>海军</option>
					<option value="3" <s:if test="patient.worktype1==1 && patient.worktype2 == 3">selected</s:if>>空军</option>
					<option value="4" <s:if test="patient.worktype1==1 && patient.worktype2 == 4">selected</s:if>>二炮</option>
					<option value="5" <s:if test="patient.worktype1==1 && patient.worktype2 == 5">selected</s:if>>离退休人员</option>
					<option value="6" <s:if test="patient.worktype1==1 && patient.worktype2 == 6">selected</s:if>>其他</option>
				</select>
			<br/>
				<input style="vertical-align:sub;" type="radio" name="patient.worktype1" id="feijunren" <s:if test="patient.worktype1==0">checked</s:if> value="0" onclick="javascript:chooseType('1');"/>
				<font style="vertical-align:sub;">非军人</font>
				<select name="patient.worktype2" id="fei" <s:if test="patient.worktype1==1">disabled="disabled"</s:if>  style="width:80px;">
					<option value="0" <s:if test="patient.worktype1==0 && patient.worktype2 == 0">selected</s:if>></option>
					<option value="1" <s:if test="patient.worktype1==0 && patient.worktype2 == 1">selected</s:if>>工人</option>
					<option value="2" <s:if test="patient.worktype1==0 && patient.worktype2 == 2">selected</s:if>>农民</option>
					<option value="3" <s:if test="patient.worktype1==0 && patient.worktype2 == 3">selected</s:if>>干部</option>
					<option value="4" <s:if test="patient.worktype1==0 && patient.worktype2 == 4">selected</s:if>>医教研</option>
					<option value="5" <s:if test="patient.worktype1==0 && patient.worktype2 == 5">selected</s:if>>个体商户</option>
					<option value="6" <s:if test="patient.worktype1==0 && patient.worktype2 == 6">selected</s:if>>服务人员</option>
					<option value="7" <s:if test="patient.worktype1==0 && patient.worktype2 == 7">selected</s:if>>家庭妇女</option>
					<option value="8" <s:if test="patient.worktype1==0 && patient.worktype2 == 8">selected</s:if>>离退休人员</option>
					<option value="9" <s:if test="patient.worktype1==0 && patient.worktype2 == 9">selected</s:if>>待业人员</option>
					<option value="10" <s:if test="patient.worktype1==0 && patient.worktype2 == 10">selected</s:if>>其他</option>
				</select></td>
		</tr>
		
		<tr>
			<td align="left" class="form-td" class="tdLabel"><label class="label">家庭住址:</label></td>
			<td align="left" class="form-td" colspan="7"><input type="text" name="patient.address" maxlength="50" id="patient.address" value="${patient.address}" require="false" dataType="Noempty" msg="请输入家庭住址" size="55"/></td>
		</tr>
		
		<tr>
			<td align="left" class="form-td"><label class="label">邮编:</label></td>
			<td align="left" class="form-td"><input type="text" name="patient.zipcode" id="patient.zipcode" value="${patient.zipcode}"/></td>
			<td align="left" class="form-td"><label class="label">联系电话:</label></td>
			<td align="left" class="form-td" colspan="5"><input type="text" name="patient.telephone" maxlength="50" id="patient.telephone" value="${patient.telephone}" dataType="Noempty" msg="请输入联系电话"/></td>
		</tr>
		
		<tr>
			<td align="left" class="form-td"><label class="label">联系人姓名:</label></td>
			<td align="left" class="form-td"><input type="text" name="patient.relate" id="patient.relate" value="${patient.relate}"/></td>
			<td align="left" class="form-td"><label class="label">联系人电话:</label></td>
			<td align="left" class="form-td" colspan="5"><input type="text" name="patient.relatephone" maxlength="50" id="patient.relatephone" value="${patient.relatephone}"/></td>
		</tr>
		
		<tr>
			<td align="left" class="form-td"><label class="label">科研入组情况</label></td>
			<td align="left" class="form-td" colspan="7"><label class="label">课题名称:</label>  
				<select name="interPG.researchgroupid" id="interPG.researchgroupid">
					<s:iterator value="groupList" status="st">
						<option value="${researchgroupid}" <s:if test="interPG.researchgroupid == researchgroupid">selected</s:if>>${groupbh}${groupname}</option>
					</s:iterator>
				</select></td>
		</tr>
	
		<tr>
			<td align="left" class="form-td"><label class="label">状态:</label></td>
			<td align="left" class="form-td" colspan="7"><select name="patient.patientstatus" id="patient.patientstatus"  style="width:80px;">
				<option value="0" <s:if test="patient.patientstatus == 0">selected</s:if>>请选择</option>
				<option value="1" <s:if test="patient.patientstatus == 1">selected</s:if>>进行中</option>
				<option value="2" <s:if test="patient.patientstatus == 2">selected</s:if>>失访</option>
				<option value="3" <s:if test="patient.patientstatus == 3">selected</s:if>>结束</option>
				<option value="4" <s:if test="patient.patientstatus == 4">selected</s:if>>退出</option>
				<option value="5" <s:if test="patient.patientstatus == 5">selected</s:if>>死亡</option>
			</select></td>
		</tr>
	</tbody>
	</table>
	<table>
		<tr>
			<td align="center"> 
			<input type="reset" value="重置">
			<input type="button" onclick="saveEdit('save');" value="保存">
			<input type="button" onclick="javascript:back();"value="返回列表"></td>
		</tr>
	</table>
</form>

<%@include file="/commons/tableSel.jsp" %>

</body>

<script>
function back(){
	location.href="${contextPath}/patient/patient.action?method=query";
}

function saveEdit(type){
	if(type=='refresh'){
		location.reload();
	}else if(type=='save'){
		if(!Validator.Validate($('patientform'),3)){
			return;
		}	
		$('patientform').submit();
	}
}
function compute(){
	var birth= $('patient.birthday').value.substr(0,4);
	var thisYear = new Date().getFullYear();
	birth = birth.substr(0,4);
	$('patient.age').value = thisYear-birth;
}
function chooseType(sel){
	if(sel==1){
		$('jun').disabled=true;
		$('fei').disabled=false;
	}else if(sel==2){
		$('jun').disabled=false;
		$('fei').disabled=true;
	}
}
function showbear(){
	if($('patient.gender').value==1){
		 //$('beartd').style.display="";
	}else{
		 //$('beartd').style.display="none";
	}
}
</script>